New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

golden-fleece

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

golden-fleece

Parse and manipulate JSON5 strings

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
68K
decreased by-37.61%
Maintainers
1
Weekly downloads
 
Created

What is golden-fleece?

The golden-fleece npm package is a utility for parsing and stringifying JavaScript objects with comments. It allows you to manipulate JavaScript objects while preserving comments, which can be useful for configuration files and other scenarios where comments are important.

What are golden-fleece's main functionalities?

Parsing JavaScript objects with comments

This feature allows you to parse a JavaScript object from a string while preserving comments. The `parse` method takes a string input and returns a JavaScript object.

const goldenFleece = require('golden-fleece');
const input = `{
  // This is a comment
  foo: 42,
  bar: 'baz'
}`;
const parsed = goldenFleece.parse(input);
console.log(parsed);

Stringifying JavaScript objects with comments

This feature allows you to convert a JavaScript object back into a string while adding comments. The `stringify` method takes an object and an optional comments object, and returns a string representation of the object with comments.

const goldenFleece = require('golden-fleece');
const obj = {
  foo: 42,
  bar: 'baz'
};
const output = goldenFleece.stringify(obj, {
  comments: {
    foo: 'This is a comment'
  }
});
console.log(output);

Other packages similar to golden-fleece

FAQs

Package last updated on 05 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc